package top.liujingyanghui.crypto.mybatisplus.rule;

import cn.hutool.crypto.SecureUtil;
import top.liujingyanghui.crypto.mybatis.rule.ICryptoRule;

/**
 * 手机号加解密
 *
 * @author : wdh
 * @since : 2022/5/23 16:15
 */
public class PhoneCryptoRule implements ICryptoRule {

    private final String KEY = "0123456789ABHAEQ";
    private final cn.hutool.crypto.symmetric.AES AES = SecureUtil.aes(KEY.getBytes());

    public String encrypt(String content) {
        return AES.encryptHex(content);
    }

    public String decrypt(String content) {
        return AES.decryptStr(content);
    }

}
